package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.info.ManagerInfo;
import com.sphd.restaurantsystem.model.DianzhangModelImpl;
import com.sphd.restaurantsystem.view.DianzhangView;

import java.util.List;

/**
 * Created by Hu on 2016/11/08
 */

public class DianzhangPresenterImpl implements DianzhangPresenter {
    DianzhangModelImpl dianzhangModel;
    DianzhangView dianzhangView;

    public DianzhangPresenterImpl(DianzhangView dianzhangView) {
        this.dianzhangView = dianzhangView;
        dianzhangModel=new DianzhangModelImpl();
    }

    @Override
    public void addData(String url) {
        dianzhangView.showLoading();
        dianzhangModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
    dianzhangView.dissLoading();
    }

    @Override
    public void sendRes(List<ManagerInfo> managerInfos) {
        dianzhangView.recRes(managerInfos);
        dianzhangView.dissLoading();
    }
}